#ifndef DECODER_FLAC_H_
#define DECODER_FLAC_H_

#include "decoder.h"
#include "decoder_flac_metadata.h"
#include "decoder_flac_frame.h"
#include "audioreader.h"

class DecoderFLAC : public Decoder {

public:
	bool checkFormat(std::string filepath);
	fileInfo getInfo();
	
	void prprForPlayback(fileInfo info);
	void fillBuffers(int16_t *buffer_l, int16_t *buffer_r, uint32_t samples);
	bool reachedEnd();
	void toFirstSample();
	uint32_t getCurrentFrame();

private:
	AudioReader reader;

	FLACMetadata metaHandler;
	FLACFrame frameHandler;
	FLACstreaminfo streaminfo;
	std::vector<FLACseekpoint> seektable;
//	Cuesheet cuesheet;
	long frameStart;
	uint32_t samplesRead;
};

#endif /* DECODER_FLAC_H_ */
